import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
import vue from '@vitejs/plugin-vue';

export default defineConfig({
    server: {
        host: 'localhost',
        port: 5173,
         
        watch: {
            usePolling: true, // 使用轮询代替文件系统事件
            interval: 100,    // 轮询间隔(毫秒)
            disableGlobbing: false,
        },
        fs: {
            strict: false,
            allow: [
                '.',
                '../vendor/laravel/framework/src/Illuminate/Filesystem',
            ]
        },
    },
    plugins: [
        laravel({
            input: ['resources/css/app.css', 'resources/js/app.js'],
            ssr: 'resources/js/ssr.js',
            refresh: true,
        }),
        vue({
            template: {
                transformAssetUrls: {
                    base: null,
                    includeAbsolute: false,
                },
            },
        }),
    ],
});
